package com.kaifamiao.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

@WebServlet("/customer/add/page")
public class CustomerAddPageServlet extends HttpServlet {

    @Override
    protected void service(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
        response.setCharacterEncoding("UTF-8");
        response.setContentType("text/html; charset=UTF-8");
        PrintWriter out = response.getWriter();
        out.println( "<link rel=\"stylesheet\" href=\"/css/customer.css\">");

        out.println( "<form action=\"/customer/add/action\" method=\"post\">");
        out.println( "<p>用户名:<input type=\"text\" name=\"username\"></p>" );
        out.println( "<p>密码:<input type=\"password\" name=\"password\"></p>" );
        out.println( "<p>确认密码:<input type=\"password\" name=\"confirm\"></p>" );
        out.println( "<p>昵称:<input type=\"text\" name=\"nickname\"></p>" );
        out.println( "<button type=\"submit\">添加</button>" );
        out.println( "</form>");
    }

}
